package com.aaa.docter.controller.api;

import com.aaa.docter.service.SchedulingService;
import com.aaa.docter.vo.Scheduling2Vo;
import com.aaa.docter.vo.SchedulingVo;
import com.aaa.entity.Scheduling;
import com.aaa.entity.User;
import com.aaa.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("doctor/scheduling/api")
public class ApiSchedulingController {

//    医生排班，我的拍班

    @Autowired
    private SchedulingService schedulingService;

//医生排班
//    http://localhost:8871/doctor/scheduling/api/queryScheduling
    @PostMapping("queryScheduling")
    public Result queryScheduling(@RequestBody SchedulingVo schedulingVo){

        return schedulingService.queryScheduling(schedulingVo);
    }
//    医生排班编辑
//修改排班信息
    @PostMapping("/editScheduling")
    public Result editScheduling(@RequestBody Scheduling2Vo scheduling2Vo){
        return schedulingService.updScheduling(scheduling2Vo);
    }


     //    医生名称字典
    @GetMapping("initUser")
    public Result <List<User>> initUser( ){
        return schedulingService.initUser( );
    }



    //  我的排版
//    http://localhost:8871/doctor/scheduling/api/getinitUser/
    @PostMapping("getinitUser")
    public  Result<User> getinitUser(@RequestBody SchedulingVo scheduling){

        return schedulingService.getinitUser(scheduling);
    }
}





